import { Component } from '@angular/core';
import { NavController,ModalController } from 'ionic-angular';
import { ENV } from '@environment';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  settingParams = {a:3,b:2,c:1};
  env:string;
  constructor(public navCtrl: NavController,public modalCtrl:ModalController) {
    console.log("多环境配置测试：",ENV.APP_SERVE_URL);
    this.env = ENV.APP_SERVE_URL;
  }

  debug():void{
    console.log('This is Home Page!');
    //this.navCtrl.push('SettingsPage');
    this.openSetting();
  }

  //显示设置页面
  openSetting(){
     let settingModal = this.modalCtrl.create('SettingsPage',this.settingParams);
     settingModal.onDidDismiss(settings =>{
         if(settings){
           this.settingParams = settings;
         }
     });
     settingModal.present();
  }

}
